﻿@model BrnMall.Web.Models.FullSendMainProductListModel
@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>满赠商品列表-@{@WorkContext.MallConfig.SiteTitle}</title>
    @Html.Raw(WorkContext.MallConfig.SEOKeyword)
    @Html.Raw(WorkContext.MallConfig.SEODescription)
    <link href="@{@WorkContext.CSSCDN}/css/base.css" rel="stylesheet" type="text/css" />
    <link href="@{@WorkContext.CSSCDN}/css/list.css" rel="stylesheet" type="text/css" />
    <script src="@{@WorkContext.ScriptCDN}/scripts/utils.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/scripts/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        uid = @WorkContext.Uid;
        isGuestSC = @WorkContext.MallConfig.IsGuestSC;
        scSubmitType = @WorkContext.MallConfig.SCSubmitType;
    </script>
</head>

<body>

<div id="headerBar" class="bigBox">
<div class="box1210">
欢迎访问 @WorkContext.MallConfig.MallName
<div  class="headerLink">
    @if (WorkContext.Uid < 1)
    {
        <a href="@Url.Action("login", "account", new RouteValueDictionary { { "returnUrl", WorkContext.Url } })">[登录]</a>
        <a href="@Url.Action("register", "account")" class="A_b">[注册]</a>
    }
    else
    {
        @:您好: @WorkContext.NickName
        <a href="@Url.Action("logout", "account")">[退出]</a>
        if (WorkContext.PartUserInfo.StoreId > 1)
        {
        <a href="@Url.Action("index", "home", new RouteValueDictionary { { "area", "storeadmin" } })">[店铺管理]</a>
        }
        if (WorkContext.MallAGid > 1)
        {
        <a href="@Url.Action("index", "home", new RouteValueDictionary { { "area", "malladmin" } })">[商城管理]</a>
        }
        <a href="@Url.Action("orderlist", "ucenter")">[我的订单]</a>
    }
</div>
</div> 
</div>

<div id="header" class="bigBox">
<div class="box1210" id="header1">
<a href="/" class="logo left"><img src="@{@WorkContext.ImageCDN}/images/logo.jpg" /></a>
<div class="search left">
<div class="searchCon">
    <input type="text" id="keyword" name="keyword" class="Stext" autocomplete="off" onkeydown="javascript:if(event.keyCode==13) mallSearch(document.getElementById('keyword').value);" value="@WorkContext.SearchWord" />
    <input name="" type="button" value="搜索" class="Sbutton" onclick="mallSearch(document.getElementById('keyword').value)" />
<div class="clear"></div>
</div>

<div class="searchHot">热门搜索：
 @{
     List<AdvertInfo> searchWordAdvertList = Adverts.GetAdvertList(5);
     }
     @Html.Raw(searchWordAdvertList[0].Body)
 </div>

</div>


<div class="shopping right" onmousemove="getCartSnap()" id="cartSnapBox" onmouseout="closeCartSnap(event)">
<h2><a href="@Url.Action("index", "cart")">我的购物车<b id="cartSnapProudctCount">@WorkContext.CartProductCount</b></a></h2>
<div id="cartSnap" class="shoppingList" style=" display:none;"><div class="loding"><img src="@{@WorkContext.ImageCDN}/images/loading.gif" /><br />加载中，请稍候... </div></div>
</div>

<div class="clear"></div>
</div>
</div>

<div id="nav" class="bigBox">
<div class="box1210">
<!-- 分类导航 -->

<div id="categorys">
<h2>全部商品分类</h2>

<div id="categorysCon">

@{
    List<NavInfo> navList = Navs.GetNavList();
    }
@{
    int layerFlag = 0;
    foreach (NavInfo info in navList)
    {
        if (info.Layer == 1)
        {
            if (layerFlag == 1)
            {
               @:</div></div>
            }
            @:<div class="item" onmouseover="this.className='item hotItem'" onmouseout="this.className='item'"><h3><a href="javascript:void(0)">@info.Name</a></h3><div class="itmeSon">
            layerFlag = 1;
        }
        else if (info.Layer == 2)
        {
            @:<dl><dt><a style="" href="javascript:void(0)">@info.Name</a></dt><dd>
            foreach (NavInfo nav in navList.FindAll(x => x.Pid == info.Id))
            {
                 @:<em><a style="" href="@nav.Url">@nav.Name</a></em>
            }
            @:</dd><div class="clear"></div></dl>
        }
    }
    @:</div></div>
}

</div>

</div>

<!-- 分类导航结束 -->

<ul id="navItme">
<li><a href="/">首页</a></li>
<li><a href="@Url.Action("category", new RouteValueDictionary { { "cateId", 55 } })">电视专场</a></li>
<li><a href="@Url.Action("category", new RouteValueDictionary { { "cateId", 65 } })">电脑专场</a></li>
<li><a href="@Url.Action("category", new RouteValueDictionary { { "cateId", 71 } })">手机专场</a></li>
</ul>
</div>
</div>

<br />

<script type="text/javascript">
    //删除购物车中商品
    function delCartProduct(pid) {
        if (isGuestSC == 0 && uid < 1) {
            alert("请先登录");
            return;
        }
        Ajax.get("/cart/delpruduct?pid=" + pid, false, function (data) {
            try {
                alert(val("(" + data + ")").content);
            }
            catch (ex) {
                removeNode(document.getElementById("item" + pid));
            }
        })
    }
</script>

<div class="box1210">
<div id="listL"></div>
<div id="listR">
@{
    List<OrderProductInfo> list = Carts.GetFullSendMainOrderProductList(Model.PmId, Model.OrderProductList);
    }
<div class="single float-nav-wrap mt">
  <div class="full">
    <div id="icon" class="s-full"></div>
    <div class="total">已加入购物车的活动商品&nbsp;&nbsp;共<font>@Carts.SumOrderProductCount(list)</font>件 总计<strong>@Carts.SumOrderProductAmount(list)</strong>元,@if(Carts.GetFullSendMinorOrderProduct(Model.PmId,Model.OrderProductList)==null){<text>已</text>}else{<text>未</text>}领取赠品</div>
    <div class="btn" onclick="window.location.href='@Url.Action("index")'"><a href="@Url.Action("index")">去购物车结算</a></div>
  </div>
  <div id="spec-list"> 
    <a id="spec-forward" class="spec-control disabled" href="javascript:;"></a>
    <div id="spec-items" class="spec-items">
      <ul>
      @foreach (OrderProductInfo info in list)
      {
        <li id="item@{@info.Pid}">
          <div class="p-img"><img width="50" height="50" src="@{@WorkContext.ImageCDN}/upload/store/@info.StoreId/product/show/thumb60_60/@info.ShowImg"></div>
          <div class="p-total"><strong>￥@info.ShopPrice</strong> X @info.RealCount</div>
          <div class="p-detal" onclick="delCartProduct(@info.Pid)">删除</div>
        </li>
      }
      </ul>
    </div>
    <a id="spec-backward" class="spec-control disabled" href="javascript:;"></a>
  </div>
</div>

<div class="orderList">
<dl>
    <dt>排序:</dt>
    <dd><a href="@Url.Action("fullsendmainproductlist", new RouteValueDictionary { { "pmId", Model.PmId }, { "startPrice", Model.StartPrice }, { "endPrice", Model.EndPrice }, { "sortColumn", 0 }, { "sortDirection", Model.SortDirection == 0 ? 1 : 0 }, { "page", 1 } })" class="@if (Model.SortColumn == 0){ <text>current</text>} @if (Model.SortDirection == 1 && Model.SortColumn == 0)
                                                                                                                                                                                                                                                                                                                                                         { <text>down</text>}
                                                                                                                                                                                                                                                                                                                                                         else if (Model.SortDirection == 0 && Model.SortColumn == 0)
                                                                                                                                                                                                                                                                                                                                                         { <text>up</text>}">销量</a></dd>
    <dd><a href="@Url.Action("fullsendmainproductlist", new RouteValueDictionary { { "pmId", Model.PmId }, { "startPrice", Model.StartPrice }, { "endPrice", Model.EndPrice }, { "sortColumn", 1 }, { "sortDirection", Model.SortDirection == 0 ? 1 : 0 }, { "page", 1 } })" class="@if (Model.SortColumn == 1){ <text>current</text>} @if (Model.SortDirection == 1 && Model.SortColumn == 1)
                                                                                                                                                                                                                                                                                                                                                         { <text>up</text>}
                                                                                                                                                                                                                                                                                                                                                         else if (Model.SortDirection == 0 && Model.SortColumn == 1)
                                                                                                                                                                                                                                                                                                                                                         { <text>down</text>}">价格</a></dd>
    <dd><a href="@Url.Action("fullsendmainproductlist", new RouteValueDictionary { { "pmId", Model.PmId }, { "startPrice", Model.StartPrice }, { "endPrice", Model.EndPrice }, { "sortColumn", 2 }, { "sortDirection", Model.SortDirection == 0 ? 1 : 0 }, { "page", 1 } })" class="@if (Model.SortColumn == 2){ <text>current</text>} @if (Model.SortDirection == 1 && Model.SortColumn == 2)
                                                                                                                                                                                                                                                                                                                                                         { <text>up</text>}
                                                                                                                                                                                                                                                                                                                                                         else if (Model.SortDirection == 0 && Model.SortColumn == 2)
                                                                                                                                                                                                                                                                                                                                                         { <text>down</text>}">评价</a></dd>
    <dd><a href="@Url.Action("fullsendmainproductlist", new RouteValueDictionary { { "pmId", Model.PmId }, { "startPrice", Model.StartPrice }, { "endPrice", Model.EndPrice }, { "sortColumn", 4 }, { "sortDirection", Model.SortDirection == 0 ? 1 : 0 }, { "page", 1 } })" class="@if (Model.SortColumn == 4){ <text>current</text>} @if (Model.SortDirection == 1 && Model.SortColumn == 4)
                                                                                                                                                                                                                                                                                                                                                         { <text>up</text>}
                                                                                                                                                                                                                                                                                                                                                         else if (Model.SortDirection == 0 && Model.SortColumn == 4)
                                                                                                                                                                                                                                                                                                                                                         { <text>down</text>}">人气</a></dd>
    <div class="clear"></div>
</dl>


<div class="orderPage">
    <span class="ProNB">共 @Model.PageModel.TotalCount 个商品</span>
    <span class="orderPageNB"><b>@if (Model.PageModel.TotalPages > 0){@Model.PageModel.PageNumber}else{<text>0</text>}</b>/@Model.PageModel.TotalPages</span>
    @if (Model.PageModel.HasPrePage)
    { 
        <a href = "@Url.Action("fullsendmainproductlist", new RouteValueDictionary { { "pmId", Model.PmId }, { "startPrice", Model.StartPrice }, { "endPrice", Model.EndPrice }, { "sortColumn", Model.SortColumn }, { "sortDirection", Model.SortDirection }, { "page", Model.PageModel.PrePageNumber } })">上一页</a>
    }
    else
    {
        <a href="javascript:;">上一页</a>
    }
    @if (Model.PageModel.HasNextPage)
    {
        <a href = "@Url.Action("fullsendmainproductlist", new RouteValueDictionary { { "pmId", Model.PmId }, { "startPrice", Model.StartPrice }, { "endPrice", Model.EndPrice }, { "sortColumn", Model.SortColumn }, { "sortDirection", Model.SortDirection }, { "page", Model.PageModel.NextPageNumber } })">下一页</a>
    }
    else
    {
        <a href="javascript:;">下一页</a>
    } 
    <div class="clear"></div>
</div>

</div>

<div class="proList">

<ul>
    @foreach (StoreProductInfo info in Model.ProductList)
    {
        <li>
            <a href="@Url.Action("product", new RouteValueDictionary { { "pid", info.Pid } })"><img src="@{@WorkContext.ImageCDN}/upload/store/@info.StoreId/product/show/thumb230_230/@info.ShowImg" width="100%" /><em>@info.Name</em></a>
            <b>¥@info.ShopPrice</b>
            <div class="info">
                <div class="star"><span class="star_yellow" style=" width:@Html.Raw((info.GetStarLevel() * 20).ToString())%;">&nbsp;</span></div>
                <a href="#">已有 @info.ReviewCount 人评价</a> 
            </div>
            <div class="info2"><span onclick="addProductToFavorite(@info.Pid)">加入收藏</span><a href="javascript:addProductToCart(@info.Pid, 1)" class="addShopping">加入购物车</a></div>
        </li>
    }
    <div class="clear"></div>
</ul>

@Html.WebPager(Model.PageModel)

</div>
</div>
<div class="clear"></div>
</div>


<div id="footer" class="bigBox">
  <div class="box1210">

    @{
        int flag = 1;
        foreach (HelpInfo info in WorkContext.HelpList)
        {
            if (info.Pid != 0)
            {
                if (info.Url.Length == 0)
                {
            <a href="@Url.Action("question", "help", new RouteValueDictionary { { "id", info.Id } })">@info.Title</a>
                }
                else
                {
            <a href="@info.Url">@info.Title</a>
                }
            }
            else
            {
                if (flag != 1)
                {
                @:</div>
            }
            @:<div class="footerBox"><h3>@info.Title</h3>
            flag++;
            }
        }
        if (WorkContext.HelpList.Count > 0)
        {
        @:</div>
    }
    }

  <div class="clear"></div>
  </div>
  <div class="bigBox footerB">
    <div id="footerB">
      <div class="links">
        @foreach (FriendLinkInfo info in WorkContext.FriendLinkList)
        {
        <a href="@info.Url" target="@info.Target" title="@info.Title">@info.Name</a> @:|
        }
      </div>
      <div>北京市公安局朝阳分局备案编号031143485246&nbsp;&nbsp;|&nbsp;&nbsp;京ICP证047722号&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" target="_blank">互联网药品信息服务资格证编号(京)-经营性-2012-0005</a>&nbsp;&nbsp;|&nbsp;&nbsp;新出发京零&nbsp;字第大145218号<br />石家庄蝶影软件开发有限公司 程序版本 @WorkContext.MallVersion 版权所有 @WorkContext.MallCopyright</div>
      <div><a href="#"><img width="108" height="40" src="@{@WorkContext.ImageCDN}/images/power_jy.gif"></a> <a href="#"><img width="108" height="40" src="@{@WorkContext.ImageCDN}/images/power_kx.gif"></a> <a href="#"><img width="108" height="40" src="@{@WorkContext.ImageCDN}/images/power_wj.png"></a> <a href="#"><img width="112" height="40" src="@{@WorkContext.ImageCDN}/images/power_cx.png"></a></div>
    </div>
  </div>
</div>
@Html.Raw(WorkContext.ExecuteDetail)
@Html.Raw(WorkContext.MallConfig.Script)
</body>
</html>
